﻿using System;
using System.Windows;

namespace WpfPostgresql
{
    /// <summary>
    /// Interaction logic for PosilkaPage.xaml
    /// </summary>
    public partial class PosilkaPage
    {
        public PosilkaPage()
        {
            InitializeComponent();

        }

        private void PageLoaded(object sender, RoutedEventArgs e)
        {
            try
            {
                DataContext = new ViewModel.PosilkaViewModel();
            }
            catch (Exception)
            {
                if (NavigationService != null) NavigationService.GoBack();
                MessageBox.Show("Нет свободного товара на складе!");
            }
        }

        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            if (NavigationService != null) NavigationService.GoBack();
        }
    }
}
